/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cmp.player.controls;

import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.AbstractControl;
import com.jme3.scene.control.Control;

/**
 *
 * @author krummer
 */
public class EnergyControl extends AbstractControl {
    
    @Override
    public void setSpatial(Spatial spatial) {
       super.setSpatial(spatial);
        this.setEnergy(100.f);
        spatial.setUserData("EnergyReg", 10.f); 
    }
    
    public void setEnergy(Float value) {
        getSpatial().setUserData("Energy", value);
    }
    
    public Float getEnergy() {
        return getSpatial().getUserData("Energy");
    }

    @Override
    protected void controlUpdate(float tpf) {
    }

    @Override
    protected void controlRender(RenderManager rm, ViewPort vp) {
    }

    public Control cloneForSpatial(Spatial spatial) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
